<?php
/**
 * Created by PhpStorm.
 * User: hao
 * Date: 2018/10/29
 * Time: 11:23 AM
 */

namespace app\api\model;


class Category extends BaseModel
{
    protected $hidden = ['delete_time','update_time','create_time'];

    public function img() {
        return $this->belongsTo('Image','topic_img_id','id');
    }

    public function productList() {
        return $this->hasMany('Product','category_id','id');
    }
}